<!-- quirks -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="renderer" content="webkit"/>
	<title>ready</title>
	<link href="../../ting-quirks.css" rel="stylesheet"/>
	<!--[if lt IE 9]><script src="../../dist/sky-compat.js"></script><![endif]-->
	<!--[if gte IE 9]><!--><script src="../../dist/sky-modern.js"></script><!--><![endif]-->
	<script src="../../demo.js"></script>
</head>
<body>
	<div class="container-fluid">
		<h2>String操作</h2>
		<h3 id="unescape">Sky.unescape</h3>
		<p>对HTML转义字符串转换成字符串。</p>
		<pre class="code">alert(Sky.unescape("&amp;lt;b&amp;gt;测试&amp;lt;/b&amp;gt;"))</pre>
		<div class="btn-toolbar">
			<a class="btn btn-primary" href="javascript:void 0;" onclick="run(this)">运行</a>
		</div>
		<h3 id="escape">Sky.escapeHtml</h3>
		<p>对 HTML 中的特殊字符进行转义。</p>
		<div id="EHW" class="border"></div>
		<pre class="code">document.getElementById("EHW").innerHTML=Sky.escapeHtml(prompt("请输入要转化的字符","&lt;b&gt;测试&lt;/b&gt;"));</pre>
		<div class="btn-toolbar">
			<a class="btn btn-primary" href="javascript:void 0;" onclick="run(this)">运行</a>
		</div>
		<h3 id="escapeString">Sky.escapeString</h3>
		<p>对 JavaScript 中的字符串特殊字符进行转义。</p>
		<pre class="code">alert(eval('"'+Sky.escapeString(prompt("请输入要转化的字符","\\t\\\""))+'"'))</pre>
		<div class="btn-toolbar">
			<a class="btn btn-primary" href="javascript:void 0;" onclick="run(this)">运行</a>
		</div>
		<h3 id="escapeRegExp">Sky.escapeRegExp</h3>
		<p>对 JavaScript 中的正则表达式特殊字符进行转义。</p>
		<pre class="code">alert("\\n\d\\n".replace(new RegExp(Sky.escapeRegExp("\d"), "g"), "HHH"))</pre>
		<div class="btn-toolbar">
			<a class="btn btn-primary" href="javascript:void 0;" onclick="run(this)">运行</a>
		</div>
		<h3 id="replaceAll">Sky.replaceAll</h3>
		<p>替换多个子字符串。</p>
		<pre class="code">alert(Sky.replaceAll("aaa/ssss/ddd/ff", "/", "-"))</pre>
		<div class="btn-toolbar">
			<a class="btn btn-primary" href="javascript:void 0;" onclick="run(this)">运行</a>
		</div>
	</div>
</body>
</html>